$(document).ready(function() {
  var server_table = $('#server_table').DataTable()
  $('input.toggle-vis').on('change', function(e) {
    e.preventDefault();
    var column = server_table.column($(this).attr('data-column'));
    column.visible(!column.visible());
  });
  var networkdevice_table = $('#networkdevice_table').DataTable()
  $('input.toggle-vis').on('change', function(e) {
    e.preventDefault();
    var column = networkdevice_table.column($(this).attr('data-column'));
    column.visible(!column.visible());
  });
  var circuits_table = $('#circuits_table').DataTable()
  $('input.toggle-vis').on('change', function(e) {
    e.preventDefault();
    var column = circuits_table.column($(this).attr('data-column'));
    column.visible(!column.visible());
  });
  var dwdm_table = $('#dwdm_table').DataTable()
  $('input.toggle-vis').on('change', function(e) {
    e.preventDefault();
    var column = dwdm_table.column($(this).attr('data-column'));
    column.visible(!column.visible());
  });
  var channel_table = $('#channel_table').DataTable()
  $('input.toggle-vis').on('change', function(e) {
    e.preventDefault();
    var column = channel_table.column($(this).attr('data-column'));
    column.visible(!column.visible());
  });
  var name = getUrlParameter('name');
  $("#name").val(name);
  var sn = getUrlParameter('sn');
  $("#sn").val(sn);
  var idc = getUrlParameter('idc');
  $("input[name='idc']").val(idc);
  var cabinet = getUrlParameter('cabinet');
  $("input[name='cabinet']").val(cabinet);
  var business_unit = getUrlParameter('business_unit');
  $("#business_unit").val(business_unit)
  var modelnumber = getUrlParameter('modelnumber');
  $("input[name='modelnumber']").val(modelnumber);
  var manufacturer = getUrlParameter('manufacturer');
  $("input[name='manufacturer']").val(manufacturer);
  var status = getUrlParameter('status');
  $("#status").val(status);
  var manage_ip = getUrlParameter('manage_ip');
  $("input[name='manage_ip']").val(manage_ip);
  var application = getUrlParameter('application');
  $("input[name='application']").val(application);
  var operation = getUrlParameter('operation');
  $("input[name='operation']").val(operation);
  var hostname = getUrlParameter('hostname');
  $("#hostname").val(hostname);
  var shortname = getUrlParameter('shortname');
  $("input[name='shortname']").val(shortname);
  var contactnumber = getUrlParameter('contactnumber');
  $("input[name='contactnumber']").val(contactnumber);
  var admin = getUrlParameter('admin');
  $("input[name='admin']").val(admin);
  var address = getUrlParameter('address');
  $("input[name='address']").val(address);
  var isp = getUrlParameter('isp');
  $("input[name='isp']").val(isp);
  var datacenter = getUrlParameter('datacenter');
  $("input[name='datacenter']").val(datacenter);
  var room = getUrlParameter('room');
  $("input[name='room']").val(room);
  var slotcount = getUrlParameter('slotcount');
  $("input[name='slotcount']").val(slotcount);
  var power = getUrlParameter('power');
  $("input[name='power']").val(power);
  var user = getUrlParameter('user');
  $("#user").val(user);
  var memo = getUrlParameter('memo');
  $("input[name='memo']").val(memo);
  var number = getUrlParameter('number');
  $("#number").val(number);
  var idc = getUrlParameter('idc');
  $("input[name='idc']").val(idc);
  var circuit_type = getUrlParameter('circuit_type');
  $("#circuit_type").val(circuit_type)
  var customer = getUrlParameter('customer');
  $("input[name='customer']").val(customer);
  var self_use_status = getUrlParameter('self_use_status');
  $("#self_use_status").val(self_use_status);
  var maintainer = getUrlParameter('maintainer');
  $("input[name='maintainer']").val(maintainer);
  var gw_ip = getUrlParameter('gw_ip');
  $("input[name='gw_ip']").val(gw_ip);
  var ipnet_customer = getUrlParameter('ipnet_customer');
  $("input[name='ipnet_customer']").val(ipnet_customer);
  var vlan = getUrlParameter('vlan');
  $("input[name='vlan']").val(vlan);
  var ipnet_status = getUrlParameter('ipnet_status');
  $("#ipnet_status").val(ipnet_status)
  var ipnet_type = getUrlParameter('ipnet_type');
  $("#ipnet_type").val(ipnet_type);
  var business_type = getUrlParameter('business_type');
  $("#business_type").val(business_type);
  var split_status = getUrlParameter('split_status');
  $("#split_status").val(split_status);
  var ipaddress_customer = getUrlParameter('ipaddress_customer');
  $("input[name='ipaddress_customer']").val(ipaddress_customer);
  var ipaddress_status = getUrlParameter('ipaddress_status');
  $("#ipaddress_status").val(ipaddress_status)
  var ipnet = getUrlParameter('ipnet');
  $("input[name='ipnet']").val(ipnet);
  var machineroom_a = getUrlParameter('machineroom_a');
  $("input[name='machineroom_a']").val(machineroom_a);
  var machineroom_z = getUrlParameter('machineroom_z');
  $("input[name='machineroom_z']").val(machineroom_z);
  var oeo = getUrlParameter('oeo');
  $("#oeo").val(oeo);
  var olp = getUrlParameter('olp');
  $("#olp").val(olp);
  var zone = getUrlParameter('zone');
  $("#zone").val(zone);
  var usage = getUrlParameter('usage');
  $("input[name='usage']").val(usage);
  var networkdevice_a = getUrlParameter('networkdevice_a');
  $("input[name='networkdevice_a']").val(networkdevice_a);
  var networkdevice_z = getUrlParameter('networkdevice_z');
  $("input[name='networkdevice_z']").val(networkdevice_z);  
});
